Skip to content

docs: Update Tauri/Rust API documentation to match current codebase#437

Merged
rahulharpal1603 merged 2 commits intoAOSSIE-Org:mainfrom
Aditya30ag:fix/update-tauri-rust-api-docs
Jul 3, 2025
Merged

docs: Update Tauri/Rust API documentation to match current codebase#437
rahulharpal1603 merged 2 commits intoAOSSIE-Org:mainfrom
Aditya30ag:fix/update-tauri-rust-api-docs

Conversation

@Aditya30ag
Copy link
Contributor

@Aditya30ag Aditya30ag commented Jul 3, 2025

Fixes #358 - Change Tauri/Rust docs to match the current state of the repository

Problem

The existing API documentation was severely outdated, listing only 5 commands while the actual codebase contains 18 commands.

Changes Made

✅ Added 13 Missing Commands:

  • share_file - File system integration
  • save_edited_image - Image processing with filters
  • get_server_path - Server resources path
  • move_to_secure_folder - Encrypted file storage
  • create_secure_folder - Secure folder creation
  • unlock_secure_folder - Secure folder authentication
  • get_secure_media - Secure media retrieval
  • remove_from_secure_folder - Secure file removal
  • check_secure_folder_status - Secure folder status
  • get_random_memories - Random memory images
  • open_folder - System folder operations
  • open_with - System "Open With" dialog
  • set_wallpaper - Desktop wallpaper setting

✅ Fixed Existing Commands:

  • Updated get_all_images_with_cache and get_all_videos_with_cache to accept directories: Vec<String> instead of directory: String

✅ Enhanced Documentation:

  • Added data structures (SecureMedia, MemoryImage)
  • Added comprehensive usage examples for all commands
  • Added security features section explaining AES-256-GCM encryption
  • Added cross-platform support information
  • Updated key components description

Result

The documentation now accurately reflects all 18 available Tauri commands, making it much easier for developers to understand and use the complete API.

Testing

  • ✅ Verified all command signatures match the actual implementation in frontend/src-tauri/src/services/mod.rs
  • ✅ Confirmed parameter types and return types are accurate
  • ✅ Added practical usage examples for each command

Summary by CodeRabbit

  • Documentation
    • Expanded and updated API documentation for the Rust backend, including support for multi-directory operations.
    • Added detailed descriptions and usage examples for new commands related to secure folder management, image editing, system integration, file sharing, and wallpaper setting.
    • Updated sections to cover new security features, encryption methods, and cross-platform support.
    • Introduced documentation for new data structures representing secure media and memory images.

Fixes AOSSIE-Org#358 - Change Tauri/Rust docs to match the current state of the repository

- Updated outdated API documentation in docs/backend/backend_rust/api.md
- Added 13 missing Tauri commands that were not documented:
  * share_file - File system integration
  * save_edited_image - Image processing with filters
  * get_server_path - Server resources path
  * move_to_secure_folder - Encrypted file storage
  * create_secure_folder - Secure folder creation
  * unlock_secure_folder - Secure folder authentication
  * get_secure_media - Secure media retrieval
  * remove_from_secure_folder - Secure file removal
  * check_secure_folder_status - Secure folder status
  * get_random_memories - Random memory images
  * open_folder - System folder operations
  * open_with - System 'Open With' dialog
  * set_wallpaper - Desktop wallpaper setting

- Fixed parameter types for existing commands:
  * get_all_images_with_cache: directory -> directories (Vec<String>)
  * get_all_videos_with_cache: directory -> directories (Vec<String>)

- Added comprehensive documentation sections:
  * Data structures (SecureMedia, MemoryImage)
  * Enhanced usage examples for all commands
  * Security features section explaining AES-256-GCM encryption
  * Cross-platform support information
  * Updated key components description

The documentation now accurately reflects all 18 available Tauri commands
instead of the previous 5, making it much easier for developers to
understand and use the complete API.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 3, 2025

Walkthrough

The Rust backend API documentation was extensively revised to reflect recent updates in the codebase. Command signatures were updated for multi-directory support, several new commands were documented, new data structures were introduced, and sections on security, system integration, and cross-platform support were added or expanded.

Changes

File(s) Change Summary
docs/backend/backend_rust/api.md Expanded and updated API documentation: new commands, updated parameters, new data structures, revised usage examples, and additional sections on security and system integration.

Assessment against linked issues

Objective Addressed Explanation
Update documentation to match current Tauri/Rust backend APIs (#358)
Reflect new/updated command signatures and parameters in documentation (#358)
Add documentation for new commands and data structures introduced in backend (#358)
Expand usage examples and describe new modules/features (#358)

Poem

In docs we trust, with Rust as our guide,
New commands and features, no longer to hide.
Secure folders, memories, and sharing with flair—
The backend’s grown stronger, with details to spare!
So hop along, dear dev, and see what’s new,
The docs are refreshed, just for you!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
docs/backend/backend_rust/api.md (2)

48-61: Consider collapsing the long parameter list into a struct

save_edited_image now exposes 11 primitive parameters. From both the JS and Rust perspectives this is brittle (easy to get ordering wrong, hard to evolve). A single settings object / struct (ImageEditOptions?) would be clearer and future-proof.

No blocking change required, but worth tracking.


177-190: JS example: clarify image_data encoding

Vec<u8> on the Rust side typically translates to a Base64‐encoded string over the invoke bridge, not a raw Uint8Array. Add a short note or convert in the snippet:

const imageBytesBase64 = await fileToBase64(file); // helper
await invoke("save_edited_image", {
  image_data: imageBytesBase64,
  /* … */
});
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8f5726 and 23fbf0a.

📒 Files selected for processing (1)
  • docs/backend/backend_rust/api.md (3 hunks)
🔇 Additional comments (3)
docs/backend/backend_rust/api.md (3)

21-31: Vector-based parameter update looks good

The wording now correctly reflects the new Vec<String> argument and the return type remains intact. Nothing else to flag here.


220-232: Great to see security details called out

Explicitly documenting AES-256-GCM, PBKDF2 and secure RNG usage is valuable for user trust. 👍


157-160: Fields must be pub for Serde to serialize

MemoryImage is returned to the frontend. With private fields it fails serde::Serialize, causing runtime errors. Either mark the fields pub or add explicit getters + #[serde(rename_all = "camelCase")] as needed.

 pub struct MemoryImage {
-    path: String,
-    created_at: DateTime<Utc>,
+    pub path: String,
+    pub created_at: DateTime<Utc>,
 }

Likely an incorrect or invalid review comment.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/backend/backend_rust/api.md (2)

167-171: Add error handling to example invocation

The invoke call may reject (invalid directory, IO error, etc.). Wrapping in try/catch (or .catch) makes the example production-ready and signals best practice to readers.

try {
  const imagesData = await invoke("get_all_images_with_cache", {
    directories: ["/path/to/images1", "/path/to/images2"],
  });
  // use imagesData
} catch (e) {
  console.error("Failed to load images:", e);
}

218-220: Minor consistency: capitalise component names uniformly

Secure Storage, Image Processing, and System Integration are capitalised while preceding items (FileService, CacheService) are camel-cased. Pick one style to avoid visual noise.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23fbf0a and 3b51037.

📒 Files selected for processing (1)
  • docs/backend/backend_rust/api.md (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Backend Tests
  • GitHub Check: Tauri Tests

@rahulharpal1603
Copy link
Contributor

Looks good!

Thank you @Aditya30ag.

@rahulharpal1603 rahulharpal1603 merged commit a646bf9 into AOSSIE-Org:main Jul 3, 2025
1 check passed
@Aditya30ag
Copy link
Contributor Author

Hi @rahulharpal1603 , thanks for merging the PR!

I'm really interested in contributing more meaningfully to the project.
Is there an active Slack, Discord, or WhatsApp group for contributors where I can stay updated and collaborate better?

Looking forward to staying connected and helping out wherever I can!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Good First Issue: Change Tauri/Rust docs to match the current state of the repository

2 participants